<html><head><base href="placeholder"></head><body><div class='definition'><pre><span style="color:#000080;font-weight:bold;">public</span> <span style="color:#000080;font-weight:bold;">class</span> <span style="color:#000000;">Hello</span></pre></div><div class='content'>
  ...
  <pre>Objects.requireNonNull(channel, "channel is null");
final var buffer = ByteBuffer.allocate(BYTES);
put(buffer);
buffer.flip();
<span style="color:#000000;background-color:#ffff00;">while (buffer.hasRemaining()) { </span>
<span style="color:#000000;background-color:#ffff00;">    final var written = channel.write(buffer);</span>
<span style="color:#000000;background-color:#ffff00;">    assert written >= 0; // why?</span>
<span style="color:#000000;background-color:#ffff00;">} </span>
return channel;</pre>
 </div><table class='sections'><p></table>